package com.swyc.osschat.Test.LambdaTest.Controller;

import java.util.function.Function;

import com.swyc.osschat.Test.LambdaTest.Bean.Student;

/**
 * 将T映射为R（转换功能）
 * 获得student对象的名字
 * @author zhaol@yunrong.cn
 * @version V2.1
 * @since 2.1.0 2019/8/9 15:14
 */
public class FunctionTest {
    public static void main(String[] args) {
        Student student = new Student("9龙", 23, 175);
        Function<Student, String> functionName = Student::getName;
        Function<Student,Long> functionAge = Student::getAirs;
        String name = functionName.apply(student);
        Long airs = functionAge.apply(student);
        System.out.println(name+airs);
    }
}
